package cn.net.isir.common;

import com.alibaba.fastjson.JSON;

import javax.servlet.http.HttpServletResponse;

public class ResultObject {
    private Integer result;
    private String message;
    private Object object;

    public ResultObject() {

    }

    public ResultObject(Integer result, String message, Object object) {
        this.result = result;
        this.message = message;
        this.object = object;
    }

    public Object getObject() {
        return object;
    }

    public void setObject(Object object) {
        this.object = object;
    }

    public Integer getResult() {
        return result;
    }

    public void setResult(Integer result) {
        this.result = result;
    }

    public void setResult(HttpServletResponse response, Integer result) {
        response.setStatus(result);
        this.result = result;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public void set(Integer result, String message, Object object) {
        this.result = result;
        this.message = message;
        this.object = object;
    }

    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }
}
